package doublepoint;

class Solution {
    public static void main(String[] args) {
        System.out.println(new Solution().removeElement(new int[]{3,2,2,3}, 3));
    }
    public int removeElement(int[] nums, int val) {
        int newArrIndex = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] != val) {
                nums[newArrIndex] = nums[i];
                newArrIndex++;
            }
        }
        return newArrIndex;
    }
}